<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Prevent OnKeyDown</title>
	<script type="text/javascript">

window.onload = function()
{
	if ( document.addEventListener )
		document.addEventListener( 'keydown', Document_OnKeyDown, false ) ;
	else
		document.attachEvent( 'onkeydown', Document_OnKeyDown ) ;
}

function Document_OnKeyDown( ev )
{
	// Get the key code.
	var keyCode = ev.keyCode || ev.which ;

	var dump = document.getElementById( 'xDump' ) ;
	dump.innerHTML = keyCode + '&nbsp;&nbsp; ' + dump.innerHTML ;

	if (  keyCode == 88 || keyCode == 13 || keyCode == 9 || keyCode == 46 ||keyCode == 8 )
	{
		if ( ev.preventDefault )
			ev.preventDefault() ;

		return false ;
	}
}

	</script>
</head>
<body>
	<h1>Prevent OnKeyDown Test Page</h1>
	<p>The [X], [Enter], [Tab], [Delete] and [Backspace] keys must not work in this page, even if combined with [Ctrl], [Shift] or [Alt].</p>
	<textarea cols="80" rows="10"></textarea>
	<div id="xDump"></div>
</body>
</html>
